package exam20170322;

/**
 * Created by dell on 2017/3/23.
 */
public class Student {
    protected String StudentName;
    protected int ID;
    protected int JavaGrade;
    public Student(String StudentName, int ID, int javaGrade) {
        this.StudentName = StudentName;
        this.ID = ID;
        this.JavaGrade = javaGrade;
    }
    public String getStudentName() {
        return StudentName;
    }
    public int getID() {
        return ID;
    }
    public int getJavaGrade() {
        return JavaGrade;
    }
    @Override
    public boolean equals(Object other) {
        if(this == other)
            return true;
        if(! (other instanceof Student))
            return false;
        Student student = (Student) other;
        if(!getStudentName().equals(student.getStudentName()))
            return false;
        if(this.getID() != student.getID())
            return false;
        if(this.getJavaGrade() != student.getJavaGrade())
            return false;
        return true;
    }
}
